﻿@{
    ViewBag.Title = "View_RechargeRecordShow";
    Layout = "~/Views/Shared/MyAccount.cshtml";
}
<link href="~/Content/BootstrapSouce/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/Content/BootstrapSouce/js/jquery.js"></script>
<script src="~/Content/BootstrapSouce/js/bootstrap.min.js"></script>
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
<script>
    var counttt = 0;
    //首次加载
    $(function ()
    {
        Page(1)
    })
    //分页
    function Page(i){
        $.post("/MyAccount/RechargeRecordPage", {
            index: i, Size:10, MinMoney: $("#MinMoney").val(), MaxMoney: $("#MaxMoney").val()
            , MaxTime: $("#MaxTime").val(), MinTime: $("#MinTime").val()
        }, function (mes) {
            
            var str = "<tr><td>充值金额</td><td>充值方式</td><td>充值时间</td><td>充值人</td></tr>";
            for (var i = 0; i < mes.Data.length; i++)
            {
                str += "<tr><td id='RechargeMoney'>" + mes.Data[i].RechargeMoney + "</td><td id='RechargeMode'>" + mes.Data[i].RechargeMode + "</td>";
                str += "<td id='RechargeTime'>" + ChangeDateFormat(mes.Data[i].RechargeTime) + "</td><td id='UserName'>" + mes.Data[i].UserName + "</td>";
                str += "</tr>";
            }
            counttt = mes.PageCount;
            var pager = "";
            pager += "<li style='float:right'><a> 共" + mes.PageCount + "页  </a></li><li style='float:right'><a> 当前第 " + mes.PageIndex + " 页</a></li>";
            pager += "<li> <a href='#' onclick='Page(1)'>首页</a></li>";
            //判断当前页是否为1，如果不是那就减一如果是那就直接定到第一页
            if (mes.PageIndex <= 1) {
                pager += ("<li><a href='#'  onclick='Page(1)'  >上一页</a></li>");
            }
            else
            {
                pager += ("<li><a href='#'  onclick='Page(" + (mes.PageIndex - 1) + ")'  >上一页</a></li>");
            }
            //判断是否为最后一页。如果不是那就加一如果是那就直接定到最后一页
            if (mes.PageIndex >= mes.PageCount) {
                pager += "<li><a  href='#' onclick='Page(" + (mes.PageCount) + ")' >下一页</a></li>";
            } else {
                pager += "<li><a  href='#' onclick='Page(" + (mes.PageIndex + 1) + ")' >下一页</a></li>";
            }
            pager += " <li><a  href='#' onclick='Page(" + mes.PageCount + ")'>尾页</a></li>";
            pager += '<li style="float:left"><a href="#" data-toggle="modal" data-target="#myModal">导出到Excle</a></li>';
            pager += '<li style="float:left"><a href="#" data-toggle="modal" data-target="#myModa3">条件查询</a></li>';
            pager += '<li style="float:left"> <a href="#"  onclick="ClearSearch()">查询全部</a></li>';
            //跳转页
            str += "";
            $("#Tbody").html(str);
            $("#pager").html(pager);
        });
    }

    function ClearSearch()
    {
        $("#MinMoney").val("0");
        $("#MaxMoney").val("0");
        $("#MaxTime").val("");
        $("#MinTime").val("");
        Page(1);
    }
    //跳转到搜索页面
    function tiaozhuan()
    {
        if ($("#pageas").val() > counttt)
        {
            alert("超出最大页数")
        }
        else
        {
            Page($("#pageas").val())
        }
    }
</script>
<div class="container">
    <h2>充值记录</h2>
</div>
<form action="/MyAccount/OutExcleAll" method="post">
    <table class="table table-hover" style="text-align:center" id="Tbody"></table>
</form>
<ul class="pager" id="pager">
    </ul>
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            &times;
                        </button>
                        <h4 class="modal-title" id="myModalLabel"></h4>
                    </div>
                    <div id="xiangqing_huiyuan" class="modal-body">
                        <ul id="myTab" class="nav nav-tabs">
                            <li class="active">
                                <a href="#" data-toggle="tab">
                                    导出到Excle
                                </a>
                            </li>
                        </ul>
                        <div id="myTabContent2" class="tab-content">
                            <div class="tab-pane fade in active" id="home">
                                <table class="table " style="text-align:center">
                                    <tr class="" id="SeachCondition" toggle="hide">
                                        <td>
                                            <ul class="pager">
                                                <li>
                                                    <a href="/MyAccount/OutExcleAll" >导出全部</a>
                                                </li>
                                                </ul>
                                        </td>
                                        <td>
                                            <ul class="pager">
                                                <li>
                                                    <a href="#" data-toggle='modal' data-target='#myModa2'>条件导出</a>
                                                </li>
                                            </ul>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal" id="btn-close">
                            关闭
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal fade" id="myModa2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <form action="/MyAccount/OutExcleAll" method="post">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                &times;
                            </button>
                            <h4 class="modal-title" id="myModalLabel"></h4>
                        </div>
                        <div id="xiangqing_huiyuan" class="modal-body">
                            <ul id="myTab" class="nav nav-tabs">
                                <li class="active">
                                    <a href="#" data-toggle="tab">
                                        条件导出到Excle
                                    </a>
                                </li>
                            </ul>
                            <div id="myTabContent2" class="tab-content">
                                <div class="tab-pane fade in active" id="home">
                                    <table class="table " style="text-align:center">
                                        <tr class="" id="SeachCondition" toggle="hide">
                                            <td>
                                                充值最小金额:<input type="number" min="1" name="MinMoney" value="0" onkeyup='this.value = this.value.replace(/\D/gi, "")' />
                                                起始时间:<input type="date" name="MinTime" value="" placeholder="" />

                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                充值最大金额:<input type="number" min="1" name="MaxMoney" value="0" onkeyup='this.value = this.value.replace(/\D/gi, "")' />
                                                结束时间:<input type="date" name="MaxTime" value="" placeholder="" />
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <input type="submit" value="导出" class="btn btn-primary" />
                            <button type="button" class="btn btn-default" data-dismiss="modal" id="btn-close">
                                关闭
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>

<div class="modal fade" id="myModa3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <form action="/MyAccount/OutExcleAll" method="post">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel"></h4>
                </div>
                <div id="xiangqing_huiyuan" class="modal-body">
                    <ul id="myTab" class="nav nav-tabs">
                        <li class="active">
                            <a href="#" data-toggle="tab">
                                指定查看
                            </a>
                        </li>
                    </ul>
                    <div id="myTabContent2" class="tab-content">
                        <div class="tab-pane fade in active" id="home">

                            <table class="table " style="text-align:center">
                                <tr class="" id="SeachCondition" toggle="hide">
                                    <td>
                                        充值最小金额:<input type="number" min="1" id="MinMoney" value="0" onkeyup='this.value = this.value.replace(/\D/gi, "")' />
                                        起始时间:<input type="date" id="MinTime" value="" placeholder="" />

                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        充值最大金额:<input type="number" min="1" id="MaxMoney" value="0" onkeyup='this.value = this.value.replace(/\D/gi, "")' />
                                        结束时间:<input type="date" id="MaxTime" value="" placeholder="" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <input type="button" value="查询" onclick="Page(1)" class="btn btn-primary" data-dismiss="modal" />
                    <button type="button" class="btn btn-default" data-dismiss="modal" id="btn-close">
                        关闭
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>






